-- GENERATED SPELL FOR [Rift Keeper] --


function spell0_21104(pUnit, Event) --@Curse of Vulnerability,n/a--
pUnit:FullCastSpellOnTarget(36276,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21104', 30299, 1)
end

function spell1_21104(pUnit, Event) --@Fear,n/a--
pUnit:FullCastSpellOnTarget(12542,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21104', 5500, 1)
end

function spell2_21104(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(8269,pUnit)
pUnit:RegisterEvent('Sorts_21104', 582, 1)
end

function spell3_21104(pUnit, Event) --@Shadow Bolt Volley,Self--
pUnit:FullCastSpellOnTarget(36275,pUnit)
pUnit:RegisterEvent('Sorts_21104', 3000, 1)
end

function spell4_21104(pUnit, Event) --@Shadow Bolt Volley,Self--
pUnit:FullCastSpellOnTarget(38533,pUnit)
pUnit:RegisterEvent('Sorts_21104', 3000, 1)
end

function Sorts_21104(pUnit, Event)
local choix_sorts_21104 = math.random(0, 4)
if choix_sorts_21104 == 0 then
pUnit:RegisterEvent('spell0_21104', 1, 1)
end
if choix_sorts_21104 == 1 then
pUnit:RegisterEvent('spell1_21104', 1, 1)
end
if choix_sorts_21104 == 2 then
pUnit:RegisterEvent('spell2_21104', 1, 1)
end
if choix_sorts_21104 == 3 then
pUnit:RegisterEvent('spell3_21104', 1, 1)
end
if choix_sorts_21104 == 4 then
pUnit:RegisterEvent('spell4_21104', 1, 1)
end
end

function mob21104_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21104', math.random(1500, 3000), 1)
end

function mob21104_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21104_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21104_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21104, 1, 'mob21104_Action')
RegisterUnitEvent(21104, 2, 'mob21104_Leave')
RegisterUnitEvent(21104, 3, 'mob21104_Kill')
RegisterUnitEvent(21104, 4, 'mob21104_Die')
